package com.song.day06.ch6_2;

import java.util.concurrent.ConcurrentLinkedDeque;

public class PollTask implements Runnable {
	
	private ConcurrentLinkedDeque<String> list;
	
	public PollTask(ConcurrentLinkedDeque<String> list) {
		super();
		this.list = list;
	}



	public void run() {
		for(int i =0; i<500 ;i++)
		{
			String first = list.pollFirst();
			String last  = list.pollLast();
			System.out.printf(" first is : %s  and last is : %s \n",first ,last);
		}

	}

}
